<div class="modal-header" id="scope">
	<h3 class="modal-title" ng-if="param.type == 'insert'">新增</h3>
	<h3 class="modal-title" ng-if="param.type == 'update'">修改</h3>
</div>
<div class="modal-body">
	<form name="myForm" class="form-horizontal form-validation">
		<div class="panel panel-default">
			<div class="panel-body">
				<div class="form-group" ng-if="param.type == 'update'">
					<label class="col-sm-3 control-label">车辆编号：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="编号" ng-model="param.data.code" ng-readonly="true"/>
					</div>
					<p>不可修改。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span
						style="color: red; text-align: center;">* &nbsp</span>车辆状态：</label>
					<div class="col-sm-5">
						<ui-select ng-model="dplist.selected" theme="bootstrap">
						<ui-select-match placeholder="车辆状态">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="dplist in dplist | propsFilter:{name: $select.search}">
						<span ng-bind-html="dplist.name | highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
					</div>
					<p>必填。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span
						style="color: red; text-align: center;">* &nbsp</span>车辆型号：</label>
					<div class="col-sm-5">
						<ui-select ng-model="modelList.selected" theme="bootstrap">
						<ui-select-match placeholder="车辆型号">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="model in modelList | propsFilter:{name: $select.search}">
						<span ng-bind-html="model.name | highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
					</div>
					<p ng-if="param.type == 'insert'">
						<button class="btn m-b-xs btn-sm btn-default btn-addon"
							type="button" ng-click="addModel()">
							<i class="fa fa-plus"></i> 添加车辆型号
						</button>
					</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span
						style="color: red; text-align: center;">* &nbsp</span>座位类型：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="座位类型"
							ng-model="param.data.model" required />
					</div>
					<p>必填。硬座/卧铺。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span
						style="color: red; text-align: center;">* &nbsp</span>车牌号：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="车牌号"
							ng-model="param.data.plate" required />
					</div>
					<p>必填。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span
						style="color: red; text-align: center;">* &nbsp</span>总座位数：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" ng-maxlength="3"
							placeholder="总座位数" ng-model="param.data.seats"
							ng-pattern="/^[0-9]*$/" required />
					</div>
					<p>必填，整数。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span
						style="color: red; text-align: center;">* &nbsp</span>可售票数：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" ng-maxlength="3"
							placeholder="可售票数" ng-model="param.data.tickets"
							ng-pattern="/^[0-9]*$/" required />
					</div>
					<p>车辆可售票数=总座位数-驾驶席数。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span
						style="color: red; text-align: center;">* &nbsp</span>所属单位：</label>
					<div class="col-sm-5">
						<ui-select ng-model="orglist.selected" theme="bootstrap">
						<ui-select-match placeholder="所属组织">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="org in orglist | propsFilter:{name: $select.search}">
						<span ng-bind-html="org.name | highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
					</div>
					<p>车辆所属的单位选择。</p>
				</div>
				<div class="form-group" ng-show="param.type == 'insert'">
					<label class="col-sm-3 control-label">车辆保险：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="保险"
							   readonly="true" ng-model="insurance.number" />
					</div>
					<p>
						<button class="btn m-b-xs btn-sm btn-default btn-addon"
								type="button" ng-click="add()">
							<i class="fa fa-plus"></i> 添加保险
						</button>
					</p>
				</div>
				<div class="form-group" ng-show="param.type == 'update'">
					<label class="col-sm-3 control-label">车辆保险：</label>
					<div class="col-sm-5"  ng-if="param.data.vehicleInsuranceId!=0">
						<input type="text" class="form-control" placeholder="保险"
							   readonly="true" ng-model="insurance.number" />
					</div>
					<div class="col-sm-5"  ng-show="param.data.vehicleInsuranceId==0">
						<p style="margin-top:7px">该车辆暂未添加保险，可点击右侧按钮进行添加。</p>
					</div>
					<p ng-show="param.data.vehicleInsuranceId==0">
						<button class="btn m-b-xs btn-sm btn-default btn-addon"
								type="button" ng-click="add()">
							<i class="fa fa-plus"></i> 添加保险
						</button>
					</p>
					<p  ng-show="param.data.vehicleInsuranceId!=0">
						<button class="btn m-b-xs btn-sm btn-default btn-addon"
								type="button" ng-click="update()">
							<i class="fa fa-pencil fa-fw m-r-xs"></i> 修改保险
						</button>
					</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">是否年检：</label>
					<div class="col-sm-4">
						<label class="i-switch m-t-xs m-r bg-info"> <input
								type="checkbox" name="inspected" ng-model="param.data.inspected"
								ng-checked="param.data.inspected==true"> <i></i>
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">是否公车：</label>
					<div class="col-sm-4">
						<label class="i-switch m-t-xs m-r bg-info"> <input
								type="checkbox" name="publicFlag"
								ng-model="param.data.publicFlag"
								ng-checked="param.data.publicFlag==true"> <i></i>
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">使用年限：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" ng-maxlength="3"
							placeholder="使用年限" ng-model="param.data.years"
							ng-pattern="/^[0-9]*$/" />
					</div>
					<p>选填，整数，默认为0。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">行驶里程数：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" ng-maxlength="10"
							placeholder="行驶里程数" ng-model="param.data.mileage"
							ng-pattern="/^[0-9]*$/" />
					</div>
					<p>选填，整数，默认为0，公里为单位。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">行驶证号：
					</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="行驶证号"
							ng-model="param.data.license"  />
					</div>
					<p>选填。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">车主姓名：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="姓名"
							ng-model="param.data.owner" ng-maxlength="10"/>
					</div>
					<p>选填。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">车主手机号：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="手机号"
							ng-model="param.data.ownerPhone"
							ng-pattern="/^[]|(1[3|4|5|7|8][0-9]\d{8})$/" />
					</div>
					<p>11位手机号，选填。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">车主身份证号：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="身份证号"
							ng-model="param.data.ownerIdCard"
							ng-pattern="/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/" />
					</div>
					<p>18位身份证号，选填。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">车主住址：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="住址"
							ng-model="param.data.ownerAddr" />
					</div>
					<p>选填。</p>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">备注：</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="备注"
							ng-model="param.data.remark" />
					</div>
					<p>选填。</p>
				</div>
<!-- 				<div class="form-group">
					<label class="col-sm-3 control-label">行驶证号：
					</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="行驶证号"
							ng-model="param.data.license"  />
					</div>
					<p>选填。</p>
				</div> -->
<!--  				<div class="form-group" ng-controller="DatepickerDemoCtrl">
					<label class="col-sm-3 control-label">驾驶证有效期（起）：
					</label>
					<div class="col-sm-5">
						<div class="input-group">
							<input type="text" class="form-control"
								datepicker-popup="{{format}}" is-open="opened"
								ng-model="timeRange.startTime" datepicker-options="dateOptions"
								close-text="Close" placeholder="驾驶证有效期（起）" readOnly /> <span
								class="input-group-btn">
								<button type="button" class="btn btn-default"
									ng-click="open($event)">
									<i class="glyphicon glyphicon-calendar"></i>
								</button>
							</span>
						</div>
					</div>
					<p>选填。</p>
				</div>
				<div class="form-group" ng-controller="DatepickerDemoCtrl">
					<label class="col-sm-3 control-label">驾驶证有效期（止）：
					</label>
					<div class="col-sm-5">
						<div class="input-group">
							<input type="text" class="form-control"
								datepicker-popup="{{format}}" is-open="opened"
								ng-model="timeRange.endTime" datepicker-options="dateOptions"
								close-text="Close" placeholder="驾驶证有效期（止）" readOnly /> <span
								class="input-group-btn">
								<button type="button" class="btn btn-default"
									ng-click="open($event)">
									<i class="glyphicon glyphicon-calendar"></i>
								</button>
							</span>
						</div>
					</div>
					<p>选填。</p>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label">驾驶证上传：
					</label>
					<div class="col-md-4" style="margin-left: 9px">
						<input type="file" class="form-control" placeholder="选择图片文件"
							ng-value="fileToUpload" value="{{fileToUpload}}"
							file-model="fileToUpload" set-file-data="fileToUpload = value;">
					</div>
					<p>选填。</p>
				</div>
				<div class="form-group" ng-show="flag">
					<label class="col-md-3 control-label">当前使用驾驶证预览：</label>
					<div class="col-md-4">
						<div class="bg-white wrapper-sm b-a">
							<div class="bg-light">
								<img ng-src="{{param.data.licensePhoto}}"
									style="width: 100%; height: 100%" />
							</div>
						</div>
					</div>
				</div>	 -->
			</div>
			<footer class="panel-footer text-right bg-light lter">
				<button class="btn btn-default" type="button" ng-click="cancel()">取消</button>
				<button type="submit" class="btn btn-success" ng-click="ok()">提交</button>
			</footer>
		</div>
	</form>
</div>